<template>
	<view>
		<charts title="短期指标" :data='dData' :up="600" :down='-400'></charts>
		<charts title="交易指数" :data='jData' :up="-140" :down='-120'></charts>
	</view>
</template>

<script setup>
	import charts from '../../components/charts.vue'
	import {
		ref,
		reactive,
		computed,
		watch
	} from 'vue';
	const data = ref([])
	
	uni.request({
		url: 'https://gitee.com/xiaochongv2/k-line/raw/master/dqzb.json', 
		method: 'GET',
		success: (res) => {
			data.value = res.data
		}
	});
	const dData = computed(() => {
		return data.value.map(item => {
			return {
				date: item.date,
				value: Number(item.dqzb)
			}
		})
	})
	const jData = computed(() => {
		return data.value.map(item => {
			return {
				date: item.date,
				value: -Number(item.jyzs)
			}
		})
	})
</script>

<style>
	       
</style>
